<!--
 * @Description: 红包列表
 * @Author: liyujie
 * @Date: 2021/2/3
 * @Last Modified by: liyujie
 * @Last Modified time: 2021/2/3
-->
<template>
    <div class="wrapper">
        <div class="content-wrapper">
            <!-- header -->
            <div class="header">
                <div class="header-title">
                    红包列表
                </div>
                <div class="add-btn">
                    <el-button
                        type="primary"
                        icon="el-icon-plus"
                        @click="toEditPacket()"
                    >
                        新建红包
                    </el-button>
                </div>
            </div>
            <!-- /header -->

            <el-tabs
                v-model="filterData.verify_status"
                @tab-click="handleTabClick"
            >
                <el-tab-pane
                    label="全部"
                    name="all"
                />
                <el-tab-pane
                    label="待提交"
                    name="1"
                />
                <el-tab-pane
                    label="待审核"
                    name="2"
                />
                <el-tab-pane
                    label="已审核"
                    name="3"
                />
            </el-tabs>
            <!-- 筛选-->
            <div class="filter-view">
                <div class="header-new-box">
                    <p class="header-new-box-title">红包信息：</p>
                    <el-input
                        placeholder="请输入优红包名称或红包编号"
                        v-model="filterData.title"
                        suffix-icon="el-icon-search"
                        clearable
                        size="medium"
                        @keydown.enter.native="getTableData(1)"
                    />
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">红包状态：</p>
                    <el-select
                        v-model="filterData.packet_status"
                        clearable
                        filterable
                        placeholder="全部"
                        size="medium"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in activeStatusList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"/>
                    </el-select>
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">渠道类型：</p>
                    <el-select
                        v-model="filterData.channel_category"
                        clearable
                        filterable
                        placeholder="全部"
                        size="medium"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in channelList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"/>
                    </el-select>
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">创建人：</p>
                    <el-input
                        placeholder="创建人"
                        v-model="filterData.admin_keyword"
                        suffix-icon="el-icon-search"
                        clearable
                        size="medium"
                        @keydown.enter.native="getTableData(1)"
                    />
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">所属岗位：</p>
                    <el-select
                        v-model="filterData.create_position_no"
                        clearable
                        filterable
                        placeholder="全部"
                        size="medium"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in positionList"
                            :key="item.position_no"
                            :label="item.name"
                            :value="item.position_no"
                        />
                    </el-select>
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">是否列入财控计划：</p>
                    <el-select
                        v-model="filterData.bind_finance_control"
                        filterable
                        placeholder="全部"
                        size="medium"
                        @change="getTableData(1)"
                    >
                        <el-option
                            label="全部"
                            :value="99"
                        />
                        <el-option
                            label="是"
                            :value="1"
                        />
                        <el-option
                            label="否"
                            :value="0"
                        />
                    </el-select>
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">创建时间：</p>
                    <el-date-picker
                        v-model="dateTimeRange"
                        type="datetimerange"
                        range-separator="-"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                        :default-time="['00:00:00', '23:59:59']"
                        size="medium"
                        style="width: 400px"
                        value-format="timestamp"
                    />
                </div>
                <div class="header-new-box">
                    <el-button
                        type="primary"
                        size="small"
                        @click="getTableData(1)"
                    >
                        查询
                    </el-button>
                    <el-button
                        type="primary"
                        size="small"
                        @click="handleExport()"
                    >
                        导出
                    </el-button>
                </div>
            </div>
            <!--筛选-->

            <!-- table -->
            <el-table
                :data="tableData"
                height="100%"
                style="width: 100%;"
                ref="tempLateName"
                class="data-table"
                v-loading="tableLoading"
            >
                <el-table-column
                    label="序号"
                    align="center"
                    width="80"
                    type="index"
                />
                <el-table-column
                    prop="title"
                    label="红包名称"
                    align="left"
                    width="140"
                    :formatter="emptyFormatter"
                >
                    <template slot-scope="scope">
                        <div class="coupon-title">
                            {{ scope.row.title }}
                        </div>
                        <div
                            class="coupon-tag"
                            v-if="!scope.row.bind_finance_control"
                        >
                            <img
                                src="@/assets/image/coupon-no-bind_finance_control.png"
                                alt=""
                            >
                        </div>
                    </template>
                </el-table-column>
                <el-table-column
                    prop="packet_no"
                    label="红包编号"
                    show-overflow-tooltip
                    align="left"
                    min-width="120"
                    :formatter="emptyFormatter"
                />
                <el-table-column
                    label="适用商品"
                    show-overflow-tooltip
                    align="left"
                    :formatter="emptyFormatter"
                >
                    <template slot-scope="scope">
                        <div v-if="scope.row.use_limit_type === 1">全部商品可用</div>
                        <div v-if="scope.row.use_limit_type === 2">指定商品可用</div>
                        <div v-if="scope.row.use_limit_type === 4">指定商品不可用</div>
                    </template>
                </el-table-column>
                <el-table-column
                    prop="discount_info"
                    label="优惠内容"
                    show-overflow-tooltip
                    align="left"
                    :formatter="emptyFormatter"
                />
                <el-table-column
                    label="有效时间"
                    show-overflow-tooltip
                    align="left"
                    width="200"
                >
                    <template slot-scope="scope">
                        <div v-if="scope.row.use_time_type === 1">
                            <div>自：{{ scope.row.use_start_time * 1000 | dateFormatter('yyyy/MM/dd HH:mm:ss') }}</div>
                            <div>至：{{ scope.row.use_end_time * 1000 | dateFormatter('yyyy/MM/dd HH:mm:ss') }}</div>
                        </div>
                        <div v-else>领取后{{ scope.row.use_day_duration }}天内生效</div>
                    </template>
                </el-table-column>
                <el-table-column
                    label="审核状态"
                    width="120"
                >
                    <template slot-scope="scope">
                        <div class="status-wrapper">
                            <div
                                class="status-dot normal"
                                v-if="scope.row.verify === 0"
                            />
                            <div
                                v-else
                                :class="['status-dot',scope.row.verify === 1 ? 'warning' : (scope.row.verify === 2 ? 'success' : 'danger')]"
                            />
                            <div class="status-name">{{ scope.row.verify | statusName }}</div>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column
                    label="活动状态"
                    align="center"
                    :formatter="emptyFormatter"
                >
                    <template slot-scope="scope">
                        <div class="status-name">{{ scope.row.packet_status | activeStatus }}</div>
                    </template>
                </el-table-column>
                <el-table-column
                    label="渠道类型"
                    align="center"
                    :formatter="emptyFormatter"
                >
                    <template slot-scope="scope">
                        <div class="status-name">{{ scope.row.channel_category | channelType }}</div>
                    </template>
                </el-table-column>
                <el-table-column
                    label="创建时间"
                    align="center"
                    width="200"
                    :formatter="emptyFormatter"
                >
                    <template slot-scope="scope">
                        {{ scope.row.create_time * 1000 | dateFormatter('yyyy/MM/dd HH:mm:ss') }}
                    </template>
                </el-table-column>
                <el-table-column
                    prop="create_admin_true_name"
                    label="创建人"
                    align="center"
                    :formatter="emptyFormatter"
                />
                <el-table-column
                    prop="create_position_name"
                    label="所属岗位"
                    align="center"
                    :formatter="emptyFormatter"
                />
                <el-table-column
                    label="发放总量"
                    align="center"
                >
                    <template slot-scope="scope">{{ scope.row.total_num_max }}张</template>
                </el-table-column>
                <el-table-column
                    label="已领取"
                    align="center"
                >
                    <template slot-scope="scope">{{ scope.row.get_count }}张</template>
                </el-table-column>
                <el-table-column
                    label="剩余"
                    align="center"
                >
                    <template slot-scope="scope">{{ scope.row.total_num_max - scope.row.get_count }}张</template>
                </el-table-column>
                <el-table-column
                    label="已使用"
                    align="center"
                >
                    <template slot-scope="scope">{{ scope.row.use_count }}张</template>
                </el-table-column>
                <el-table-column
                    label="可推广数量"
                    align="center"
                    width="110"
                >
                    <template slot-scope="scope">{{ scope.row.total_num }}张</template>
                </el-table-column>
                <el-table-column
                    label="可推广剩余"
                    align="center"
                    width="110"
                >
                    <template slot-scope="scope">{{ scope.row.rest_count }}张</template>
                </el-table-column>
                <el-table-column
                    label="操作"
                    align="left"
                    width="240"
                    fixed="right"
                >
                    <template slot-scope="scope">
                        <el-button
                            type="text"
                            @click="toPacketDetail(scope.row.packet_no, scope.row.packet_status, scope.row.verify)"
                        >
                            查看
                        </el-button>
                        <el-button
                            type="text"
                            @click="toEditPacket(scope.row.packet_no, scope.row.packet_status, scope.row.verify, 'edit')"
                            v-if="scope.row.verify !== 1 && (scope.row.packet_status === 1 || scope.row.packet_status === 2 || scope.row.packet_status === 3)"
                        >
                            编辑
                        </el-button>
                        <el-button
                            type="text"
                            v-if="scope.row.packet_status === 2 || scope.row.packet_status === 3"
                            @click="$refs.redPacketExtension.show(scope.row.packet_no)"
                        >
                            推广
                        </el-button>
                        <el-button
                            type="text"
                            @click="toStatisticsPage(scope.row.packet_no)"
                            v-if="scope.row.packet_status !== 1"
                        >
                            统计
                        </el-button>
                        <el-button
                            type="text"
                            @click="showInvalidDialog(scope.row.packet_no)"
                            v-if="scope.row.packet_status ===2 || scope.row.packet_status === 3"
                        >
                            失效
                        </el-button>
                        <el-button
                            type="text"
                            @click="handleExamine(scope.row.packet_no)"
                            v-if="scope.row.verify === 0 || scope.row.verify === 3"
                        >
                            提交审核
                        </el-button>
                        <el-button
                            type="text"
                            v-if="scope.row.verify === 3"
                            @click="showReasonDialog(scope.row.verify_reason)"
                        >
                            驳回原因
                        </el-button>
                        <el-button
                            type="text"
                            @click="deletePacket(scope.row.packet_no)"
                            v-if="scope.row.verify === 0"
                        >
                            删除
                        </el-button>
                        <el-button
                            type="text"
                            @click="copyPacket(scope.row.packet_no)"
                        >
                            复制
                        </el-button>
                        <el-button
                            type="text"
                            @click="handleWithdraw(scope.row.packet_no)"
                            v-if="scope.row.verify === 1"
                        >
                            撤回
                        </el-button>
                        <el-button
                            type="text"
                            @click="$refs.redPacketGrant.show(scope.row.packet_no)"
                            v-if="scope.row.packet_status === 2 || scope.row.packet_status === 3"
                        >
                            发红包
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>

            <!-- /分页 -->
            <div class="pagination-wrapper clearfix">
                <el-pagination
                    layout="total, prev, pager, next, jumper"
                    background
                    :current-page.sync="page.now_page"
                    :total="page.total_count"
                    :page-size="page.page_size"
                    @current-change="getTableData"
                />
            </div>
            <!-- /table -->

            <!-- 失效弹窗 -->
            <div
                class="fixed"
                v-if="invalidDialog"
            >
                <div class="wrap">
                    <i
                        class="el-icon-close"
                        @click="invalidDialog = false"
                    />
                    <img
                        src="@/assets/image/zd-jg.png"
                        class="wrap-logo"
                    >
                    <p class="wrap-title">
                        失效提示
                    </p>
                    <p class="wrap-tip">
                        活动失效后，无法继续编辑红包内容；
                        用户无法再领取该红包，但之前已领取的红包在有效期内仍可继续使用。确定失效？
                    </p>
                    <div class="wrap-foot">
                        <el-button
                            size="small"
                            type="default"
                            :style="{width: '100px', height: '32px'}"
                            @click="invalidDialog = false"
                        >
                            取消
                        </el-button>
                        <el-button
                            size="small"
                            type="primary"
                            :style="{width: '100px', height: '32px', marginLeft: '40px'}"
                            @click="setPacketInvalid()"
                        >
                            确定
                        </el-button>
                    </div>
                </div>
            </div>
            <!-- /失效弹窗 -->

            <!--驳回原因弹窗-->
            <el-dialog
                title="驳回原因"
                :visible.sync="reasonDialog"
                width="614px"
                :close-on-click-modal="false"
            >
                <div
                    class="reject-reason"
                >
                    <div class="reason-wrapper">{{ reasonDetail }}</div>
                    <el-button
                        type="primary"
                        class="know-btn"
                        size="middle"
                        @click="reasonDialog = false"
                    >
                        知道了
                    </el-button>
                </div>

            </el-dialog>
            <!--/驳回原因弹窗-->
            <!-- 红包推广 -->
            <red-packet-extension
                ref="redPacketExtension"
                @update="getTableData(1)"
            />
            <!-- 红包发放 -->
            <red-packet-grant
                ref="redPacketGrant"
                @update="getTableData(1)"
            />
        </div>
    </div>
</template>

<script>
import redPacketExtension from '@/components/red-packet/red-packet-extension';
import RedPacketGrant from '@/components/red-packet/red-packet-grant';
import { back } from '@/mixin/back';

export default {
    name: 'RedPacketList',
    components: {
        RedPacketGrant,
        redPacketExtension
    },
    mixins: [back],
    filters: {
        statusName(val) {
            switch (val) {
                case 0:
                    return '待提交';
                case 1:
                    return '待审核';
                case 2:
                    return '已通过';
                case 3:
                    return '不通过';
                default:
                    return '';
            }
        },
        activeStatus(val) {
            switch (val) {
                case 1:
                    return '未生效';
                case 2:
                    return '已生效';
                case 3:
                    return '进行中';
                case 4:
                    return '已失效';
                case 5:
                    return '已过期';
                default:
                    return '';
            }
        },
        channelType(val) {
            switch (val) {
                case 'shop':
                    return '商城';
                case 'private_area':
                    return '私域';
                case 'stuagent':
                    return '代理';
                case 'student_vip':
                    return '一卡通会员';
                default:
                    return '--';
            }
        }
    },
    computed: {},
    data() {
        return {
            filterData: {
                // 红包名称或红包编号
                title: '',
                // 审核状态
                verify_status: 'all',
                // 活动状态
                packet_status: '',
                // 渠道类型
                channel_category: '',
                // 创建人
                admin_keyword: '',
                // 创建时间
                create_start_time: '',
                create_end_time: '',
                // 所属岗位
                create_position_no: '',
                // 是否列入财控
                bind_finance_control: 99
            },
            dateTimeRange: [],
            statusList: [],
            tableData: [],
            tableLoading: false,
            page: {
                now_page: 1,
                total_count: 0,
                page_size: 20
            },
            //活动状态
            activeStatusList: [
                {label: '未生效', value: 1},
                {label: '已生效', value: 2},
                {label: '进行中', value: 3},
                {label: '已失效', value: 4},
                {label: '已过期', value: 5},
            ],
            // 渠道类型选项
            channelList: [
                {label: '商城', value: 'shop'},
                {label: '私域', value: 'private_area'},
                {label: '代理', value: 'stuagent'},
                {label: '一卡通会员', value: 'student_vip'}
            ],
            positionList: [],
            invalidDialog: false,
            // 要设置失效的id
            invalidId: '',
            // 驳回原因弹窗
            reasonDialog: false,
            // 驳回原因
            reasonDetail: '',
            authResult: {}
        };
    },
    watch: {
        dateTimeRange(value) {
            this.filterData.create_start_time = value ? value[0] / 1000 : '';
            this.filterData.create_end_time = value ? value[1] / 1000 : '';
            this.getTableData(1);
        }
    },

    mounted() {
        this.$store.commit('SET_HEADER', [{title: "APP后台"}, {title: '商城'}, {title: '红包'}]);
        this.authResult = this.$route.meta.authResult;
        this.getTableData();
        this.getPositionList();
    },

    methods: {

        /**
         * @description 获取岗位列表
         */
        getPositionList() {
            this.$post('/__local/system%5Cdepartment_position%5Cget_simple_list', {}, resp => {
                if (resp.code === 1) {
                    this.positionList = resp.data.list;
                }
            });
        },

        /**
         * @description 获取表红包列表数据
         * @param page
         */
        getTableData(page) {
            this.tableLoading = true;
            let params = {...this.filterData};

            if (params.verify_status === 'all') {
                params.verify_status = '';
            } else {
                params.verify_status = Number(params.verify_status);
            }
            params.page_id = page || this.page.now_page;

            this.$post('/student/shop_goods_red_packet%5Cget_list', params, resp => {
                if (resp.code === 1) {
                    this.tableData = resp.data.list;
                    this.page = resp.data.page;
                } else {
                    this.$notify({
                        title: '提示',
                        message: resp.msg,
                        type: 'warning'
                    });
                }
                this.tableLoading = false;
            });
        },

        /**
         * @description 过滤函数
         */
        emptyFormatter(row, column, val) {
            if (!val) return '--';
            return val;
        },

        /**
         * 跳转编辑页面
         * @param no - 红包编号
         * @param packet_status - 活动状态
         * @param verify_status - 审核状态
         * @param mode - add新增 edit编辑 detail查看
         */
        toEditPacket(no = '', packet_status = '',verify_status = '', mode = 'add') {
            this.$router.push({
                name: 'redPacketEditor',
                query: {
                    no,
                    packet_status,
                    verify_status,
                    mode
                }
            });
        },

        /**
         * tab审核状态切换
         * @param tab
         * @param event
         */
        handleTabClick(tab, event) {
            this.getTableData(1);
        },

        /**
         * 跳转红包详情
         * @param no - 红包编号
         * @param packet_status - 活动状态
         * @param verify_status - 审核状态
         */
        toPacketDetail(no, packet_status = '',verify_status = '') {
            this.$router.push({
                path: '/student/red-packet-detail',
                query: {
                    no,
                    packet_status,
                    verify_status,
                    mode: 'detail'
                }
            });
        },

        /**
         * 显示失效弹窗
         * @param id
         */
        showInvalidDialog(id) {

            this.invalidDialog = true;
            this.invalidId = id;
        },

        /**
         * 设置红包失效
         */
        setPacketInvalid() {

            let params = {
                packet_no: this.invalidId
            };

            this.$post('/student/shop_goods_red_packet%5Cexpired', params, resp => {
                if (resp.code === 1) {
                    this.$message.success('设置失效成功');
                    this.invalidDialog = false;
                    this.getTableData();
                } else {
                    this.$notify({
                        title: '失败',
                        message: resp.msg,
                        duration: 2000,
                        type: 'warning'
                    });
                }
            });

        },

        /**
         * 提交审核
         * @param id
         */
        handleExamine(id) {
            let params = {
                packet_no: id
            };

            this.$confirm('是否确认提交审核?','提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$post('/student/shop_goods_red_packet%5Csubmit_audit', params, resp => {
                    if (resp.code === 1) {
                        this.$message.success('提交审核成功');
                        this.getTableData();
                    } else {
                        this.$notify({
                            title: '失败',
                            message: resp.msg,
                            duration: 2000,
                            type: 'warning'
                        });
                    }
                });
            });

        },

        /**
         * 删除红包
         * @param id
         */
        deletePacket(id) {
            if(!this.authResult.auth_delete) {
                this.$notify({
                    title: '提示',
                    message: '请联系管理员添加权限',
                    type: 'warning',
                    duration: 2000
                });
                return false;
            }

            let params = {
                packet_no: id
            };

            this.$confirm('是否要删除红包?','提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$post('/student/shop_goods_red_packet%5Cdelete', params, resp => {
                    if (resp.code === 1) {

                        this.$message.success('删除成功');
                        this.getTableData();
                    } else {
                        this.$notify({
                            title: '失败',
                            message: resp.msg,
                            duration: 2000,
                            type: 'warning'
                        });
                    }
                });
            });

        },

        /**
         * 跳转统计页面
         * @param no
         */
        toStatisticsPage(no) {
            this.$router.push({
                path: '/student/red-packet-data-statistics',
                query: {
                    no
                }
            });
        },

        /**
         * 显示驳回原因弹窗
         * @param reason
         */
        showReasonDialog(reason) {

            this.reasonDetail = reason;
            this.reasonDialog = true;
        },

        /**
         * 复制红包
         * @param no
         */
        copyPacket(no) {
            this.$router.push({
                name: 'redPacketEditor',
                query: {
                    no,
                    isCopy: 1,
                    mode: 'add'
                }
            });
        },

        /**
         * 撤回红包审核
         * @param no
         */
        handleWithdraw(no) {

            let params = {
                packet_no: no
            };

            this.$confirm('是否确认撤回该红包活动审核?','提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$post('/student/shop_goods_red_packet%5Crepeal', params, resp => {
                    if (resp.code === 1) {
                        this.$message.success('撤回成功');
                        this.getTableData();
                    } else {
                        this.$notify({
                            title: '提示',
                            message: resp.msg,
                            duration: 2000,
                            type: 'warning'
                        });
                    }
                });
            });
        },

        /**
         * 导出数据
         */
        handleExport() {
            let params = {...this.filterData};

            if (params.verify_status === 'all') {
                params.verify_status = '';
            } else {
                params.verify_status = Number(params.verify_status);
            }

            let base = this.$baseUrl;
            let ticket = localStorage.getItem('sessionTicket');
            let queryStr = Object.keys(params)
                .map(key => `${key}=${params[key]}`)
                .join('&');
            let url = `${base}/student/shop_goods_red_packet%5Cexport_list?${queryStr}&__ticket=${ticket}`;

            window.open(url);
        },
    },
};
</script>

<style lang="less" scoped>
.wrapper {
    width: 100%;

    .content-wrapper {
        display: flex;
        height: calc(100% - 24px);
        flex-direction: column;
        position: relative;
        margin: 12px;
        background: #fff;
        box-sizing: border-box;

        /*header*/

        .header {
            height: 68px;
            padding: 24px;
            box-sizing: border-box;
            box-shadow: 0px -1px 0px 0px #F0F2F5;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid #F0F2F5;

            .header-title {
                color: #333333;
                font-size: 20px;
                height: 20px;
                font-weight: 500;
                position: relative;
                margin: 24px 0 24px 12px;

                &::before {
                    content: '';
                    position: absolute;
                    left: -8px;
                    top: -1px;
                    width: 3px;
                    height: 20px;
                    background: #1890FF;
                }
            }
        }

        /*el-tabs*/

        /deep/ .el-tabs {

            .el-tabs__nav-wrap {
                height: 54px;
                padding-left: 24px;

                .el-tabs__nav-scroll {
                    .el-tabs__nav {
                        height: 54px;
                        line-height: 54px;
                    }
                }
            }

        }

        /*筛选*/

        .filter-view {
            padding: 0 24px;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            flex-wrap: wrap;

            .header-new-box {
                display: flex;
                align-items: center;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #333333;
                white-space: nowrap;
                margin-right: 24px;
                margin-bottom: 16px;

                &-title {
                    margin-right: 16px;
                    white-space: nowrap;
                }
            }

            .input-with-select {
                width: 300px;
                margin-right: 32px;
            }

            /deep/ .input-with-select .el-input-group__prepend {
                background-color: #fff;
                width: 130px;
            }
        }

        /*table*/

        .data-table {
            ::-webkit-scrollbar {
                width: 6px;
                height: 6px;
            }
            .el-button {
                margin-left: 0;
                margin-right: 10px;
                .el-icon-arrow-down {
                    margin-left: 0;
                }
            }
        }
        .coupon-title {
            width: 124px;
            overflow : hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
        .coupon-tag {
            img {
                height: 14px;
                margin-top: 8px;
            }
        }
        .status-wrapper {
            display: flex;
            align-items: center;

            .status-dot {
                width: 6px;
                height: 6px;
                border-radius: 50%;
                margin-right: 5px;

                &.success {
                    background: #4CD964;
                }

                &.danger {
                    background: #FF3030;
                }

                &.warning {
                    background: #FFA72D;
                }

                &.normal {
                    background: #1890FF;
                }
            }
        }

        .fixed {
            position: fixed;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0;
            margin: auto;
            background: rgba(0, 0, 0, 0.6);
            z-index: 10008;
            display: flex;
            justify-content: center;
            align-items: center;

            .wrap {
                width: 360px;
                height: 258px;
                background: rgba(255, 255, 255, 1);
                border-radius: 4px;
                box-sizing: border-box;
                display: flex;
                flex-direction: column;
                align-items: center;

                .el-icon-close {
                    color: #C0CCDA;
                    font-size: 18px;
                    font-weight: 500;
                    margin-left: 325px;
                    cursor: pointer;
                    margin-top: 14px;
                }

                .wrap-logo {
                    width: 48px;
                    height: 48px;
                    border-radius: 50%;
                    margin-bottom: 12px;
                }

                .wrap-title {
                    color: #333333;
                    font-size: 16px;
                    font-weight: 500;
                }

                .wrap-tip {
                    color: #666;
                    font-size: 14px;
                    padding: 0 32px;
                    line-height: 20px;
                    box-sizing: border-box;
                    margin: 14px 0 24px 0;
                    text-align: center;
                }

                .wrap-foot {
                    width: 100%;
                    height: 32px;
                    display: flex;
                    justify-content: center;
                }
            }
        }

        /* 分页 */

        .pagination-wrapper {
            padding: 10px 32px;

            .el-pagination {
                float: right;
                padding: 0;
                background-color: transparent;
            }
        }
        /*dialog弹窗样式*/
        .reject-reason {
            display: flex;
            flex-direction: column;
            align-items: center;
            .reason-wrapper {
                width: 100%;
                padding: 24px;
                background: #FBFBFB;
                border-radius: 4px;
                border: 1px solid #EEEEEE;
                line-height: 20px;
                margin: 4px 34px;
            }
            .know-btn {
                width: 120px;
                margin-top: 30px;
            }
        }
        /deep/ .el-dialog__header {
            padding-top: 10px;
            box-shadow:0px 1px 0px 0px rgba(233,233,233,1);
            display: flex;
            align-items: center;
            background: #FAFAFA;
            border-radius: 4px 4px 0 0;
            .el-dialog__title {
                font-weight: 500;
                color: #333;
                font-size: 14px;
            }
            .el-icon-close:before {
                color: rgb(194,194,194);
                font-size: 17px;
                font-weight: bold;
            }
            .el-dialog__headerbtn {
                top: 14px;
            }
        }
        .el-textarea__inner {
            resize: none;
        }
    }
}
</style>
